home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / elecmail / fido1000.zip / SRC1000.ZIP / MARKALL.C < prev    next >
C/C++ Source or Header  |  1993-05-21  |  1KB  |  59 lines

  1. #include    "gt16.h"
  2. #include    "ftsc.h"
  3. #include    "transfer.h"
  4. #include    <bios.h>
  5. #include    <conio.h>
  6. #include    <dos.h>
  7. #include    <process.h>
  8. #include    <stdio.h>
  9. #include    <stdlib.h>
  10. #include    <string.h>
  11. #include    <time.h>
  12.  
  13.  
  14. int  main(int,char *[]);
  15.  
  16. int     main(int argc, char *argv[])
  17. {
  18.     MSG_RECORD  *ghdr;
  19.     char        *fin,*fout;
  20.     FILE        *fpin,*fpout;
  21.     int         got;
  22.  
  23.  
  24.     ghdr = malloc(130);
  25.     fin = malloc(80);
  26.     fout = malloc(80);
  27.  
  28.  
  29.     if (argc != 2) exit(1);
  30.  
  31.  
  32.     strcpy(fin,argv[1]);
  33.     strcpy(fout,argv[1]);
  34.     strcat(fin,"\\MESSAGE.CTL");
  35.     strcat(fout,"\\MESSAGE.$$$");
  36.     if ((fpin = fopen(fin,"rb")) == NULL)
  37.     {
  38.         return(-1);
  39.     }
  40.     if ((fpout = fopen(fout,"wb")) == NULL)
  41.     {
  42.         return(-1);
  43.     }
  44.     while (!(feof(fpin)))
  45.     {
  46.         got = fread(ghdr,MSGCTLSZ,1,fpin);
  47.         ghdr->msg_flags.fidoorg = 1;
  48.         if (got) fwrite(ghdr,MSGCTLSZ,1,fpout);
  49.     }
  50.     fclose(fpin);
  51.     fclose(fpout);
  52.     filecopy(fin,"H:\MESSAGE.BAK");
  53.     filecopy(fout,fin);
  54.     remove(fout);
  55.  
  56.     return(0);
  57. }
  58.  
  59.